package com.example.myproject.controller;

import com.example.myproject.PersonProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {
   /* @RequestMapping("/hello")
    public String say(){
        return "Hello SpringBoot!";
        */
  /* @Value("${name}")
    private String name;
    */
   @Autowired
    private PersonProperties personProperties;
   @RequestMapping(value="/hello",method= RequestMethod.GET)
    public String say(){
         return personProperties.getName()+personProperties.getAge();
    }
}
